package com.example.testjni;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;

public class MainActivity extends Activity implements OnClickListener
{
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
    }
    
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.test:
                JniUtil jniUtil = new JniUtil();
                String result = null;
                result = jniUtil.testHelloJni();
                Log.d("TAG", "testHelloJni " + result);
                result = jniUtil.testAppendString("string from java ---------> this from c !!   ");
                Log.d("TAG", "testAppendString " + result);
                result = JniUtil.testStaticAppendString("string from java ---------> this from c !!");
                Log.d("TAG", "testStaticAppendString " + result + "");
                int res = jniUtil.testSendIr(18000, new int[] { 15, 56, 56514 });
                Log.d("TAG", "testSendIr " + res + "");
                break;
            
            default:
                break;
        }
    }
}
